local zhuobi_active = fk.CreateSkill {
  name = "#th_zhuobi_active",
}

zhuobi_active:addEffect("active", {
  name = "#th_zhuobi_active",
  card_num = 0,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected, _, _, extra_data)
    if #selected < extra_data.num then
      if table.contains(extra_data.targets, to_select.id) then
        if selected[1] then
          return not table.contains(extra_data.extra_data, selected[1].id) == not table.contains(extra_data.extra_data, to_select.id)
        end
        return true
      end
    end
  end,
  target_tip = function(self, player, to_select, selected, _, _, selectable, extra_data)
    if not selectable then return end
    if type(extra_data.extra_data) == "table" then
      if table.contains(extra_data.extra_data, to_select.id) then
        return { {content = "@@CancelTarget", type = "warning"} }
      else
        return { {content = "@@AddTarget", type = "normal"} }
      end
    end
  end,
  min_target_num = function(self) return self.min_num end,
  max_target_num = function(self) return self.num end,
})

return zhuobi_active